import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
import NewMain from '../views/new/NewMain.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/home',
    name: 'home',
    component: HomeView,
    children:[
      {
        path: '/home/index',
        name: 'index',
        component: () => import('../views/AAA.vue')
      },
      {
        path: '/home/home_type',
        name: 'home_type',
        component: () => import( '../views/HomeType.vue')
      }
    ]
  },
  {
    path: '/main',
    name: 'main',
    component: NewMain,
    children:[
      {
        path: '/main/index',
        name: 'new_index',
        component: () => import('../views/new/NewIndex.vue')
      },
      {
        path: '/main/home_type',
        name: 'new_home_type',
        component: () => import( '../views/new/NewHomeType.vue')
      },
      {
        path: '/main/home',
        name: 'new_home',
        component: () => import( '../views/new/NewHome.vue')
      }
    ]
  },
  {
    path: '/about',
    name: 'about',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/AboutView.vue')
  },
  {
    path: '/login',
    name: 'login',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/login.vue')
  },
  {
    path: '/login2',
    name: 'login2',
    // route level code-splitting
    // this generates a separate chunk (about.[hash].js) for this route
    // which is lazy-loaded when the route is visited.
    component: () => import(/* webpackChunkName: "about" */ '../views/login2.vue')
  },

]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
